﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:CCWP7_CaliburnMicro_Framework="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
    xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:local="clr-namespace:CCWP7.CaliburnMicro" x:Name="phoneApplicationPage" 
    xmlns:behaviors="clr-namespace:CCWP7.CaliburnMicro.Behaviors"
    behaviors:TiltEffect.IsTiltEnabled="True"
    x:Class="CCWP7.CaliburnMicro.AddServerPage"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <CCWP7_CaliburnMicro_Framework:AppBarButton IconUri="/icons/appbar.check.rest.png" Message="AddServer" Text="add server"/>
            <CCWP7_CaliburnMicro_Framework:AppBarButton IconUri="/icons/appbar.cancel.rest.png" Message="Cancel" Text="cancel"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="#FFA8DBA8">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.5" To="Adding">
                        <VisualTransition.GeneratedEasingFunction>
                            <QuinticEase EasingMode="EaseOut"/>
                        </VisualTransition.GeneratedEasingFunction>
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="AddingPanel">
                                <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                                <DiscreteObjectKeyFrame KeyTime="0:0:0.5">
                                    <DiscreteObjectKeyFrame.Value>
                                        <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                </DiscreteObjectKeyFrame>
                            </ObjectAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="AddingPanel">
                                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Default"/>
                <VisualState x:Name="Adding">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="AddingPanel">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <StackPanel>
                <TextBlock Style="{StaticResource PhoneTextNormalStyle}"><Run Text="Server DNS:"/></TextBlock>
                <TextBox x:Name="ServerName" InputScope="Url" />
                <TextBlock Style="{StaticResource PhoneTextNormalStyle}"><Run Text="Server Port:"/></TextBlock>
                <TextBox x:Name="PortNumber" InputScope="Number"/>
                <TextBlock Style="{StaticResource PhoneTextNormalStyle}"><Run Text="Full Uri:"/></TextBlock>
                <TextBox x:Name="FullAddress" InputScope="Url"/>
            </StackPanel>
        </Grid>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppTitle}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="add server" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <Grid x:Name="AddingPanel" Background="{StaticResource PhoneDisabledBrush}" Visibility="Collapsed" Grid.RowSpan="2">
            <Border HorizontalAlignment="Center" Margin="0,0,1,46" VerticalAlignment="Center" d:LayoutOverrides="Height" BorderThickness="5" Background="Black" CornerRadius="3" BorderBrush="{StaticResource PhoneBorderBrush}">
                <StackPanel Orientation="Vertical" Margin="12" Width="196">
                    <TextBlock  Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" VerticalAlignment="Top" d:LayoutOverrides="Width" Text="adding server..." HorizontalAlignment="Center" Foreground="{StaticResource PhoneAccentBrush}"/>
                    <ProgressBar Height="10" IsIndeterminate="True"/>
                </StackPanel>
            </Border>
        </Grid>

    </Grid>

</phone:PhoneApplicationPage>
